Integrand size = 29, antiderivative size = 105 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\frac {1}{8} (4 a A+3 b B) x+\frac {(A b+a B) \sin (c+d x)}{d}+\frac {(4 a A+3 b B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {b B \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {(A b+a B) \sin ^3(c+d x)}{3 d} \]
[Out]
Time = 0.29 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {3047, 3102, 2827, 2715, 8, 2713} \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=-\frac {(a B+A b) \sin ^3(c+d x)}{3 d}+\frac {(a B+A b) \sin (c+d x)}{d}+\frac {(4 a A+3 b B) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} x (4 a A+3 b B)+\frac {b B \sin (c+d x) \cos ^3(c+d x)}{4 d} \]
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2827
Rule 3047
Rule 3102
Rubi steps \begin{align*} \text {integral}& = \int \cos ^2(c+d x) \left (a A+(A b+a B) \cos (c+d x)+b B \cos ^2(c+d x)\right ) \, dx \\ & = \frac {b B \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{4} \int \cos ^2(c+d x) (4 a A+3 b B+4 (A b+a B) \cos (c+d x)) \, dx \\ & = \frac {b B \cos ^3(c+d x) \sin (c+d x)}{4 d}+(A b+a B) \int \cos ^3(c+d x) \, dx+\frac {1}{4} (4 a A+3 b B) \int \cos ^2(c+d x) \, dx \\ & = \frac {(4 a A+3 b B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {b B \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{8} (4 a A+3 b B) \int 1 \, dx-\frac {(A b+a B) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d} \\ & = \frac {1}{8} (4 a A+3 b B) x+\frac {(A b+a B) \sin (c+d x)}{d}+\frac {(4 a A+3 b B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {b B \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {(A b+a B) \sin ^3(c+d x)}{3 d} \\ \end{align*}
Time = 0.21 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.87 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\frac {48 a A c+36 b B c+48 a A d x+36 b B d x+96 (A b+a B) \sin (c+d x)-32 (A b+a B) \sin ^3(c+d x)+24 (a A+b B) \sin (2 (c+d x))+3 b B \sin (4 (c+d x))}{96 d} \]
[In]
[Out]
Time = 2.96 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.82
method | result | size |
parallelrisch | \(\frac {\left (24 a A +24 B b \right ) \sin \left (2 d x +2 c \right )+\left (8 A b +8 B a \right ) \sin \left (3 d x +3 c \right )+3 B b \sin \left (4 d x +4 c \right )+\left (72 A b +72 B a \right ) \sin \left (d x +c \right )+48 \left (a A +\frac {3 B b}{4}\right ) x d}{96 d}\) | \(86\) |
parts | \(\frac {\left (A b +B a \right ) \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {B b \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(97\) |
derivativedivides | \(\frac {B b \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {B a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(107\) |
default | \(\frac {B b \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {B a \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(107\) |
risch | \(\frac {x a A}{2}+\frac {3 b B x}{8}+\frac {3 \sin \left (d x +c \right ) A b}{4 d}+\frac {3 a B \sin \left (d x +c \right )}{4 d}+\frac {B b \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) A b}{12 d}+\frac {\sin \left (3 d x +3 c \right ) B a}{12 d}+\frac {\sin \left (2 d x +2 c \right ) a A}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B b}{4 d}\) | \(118\) |
norman | \(\frac {\left (\frac {a A}{2}+\frac {3 B b}{8}\right ) x +\left (2 a A +\frac {3 B b}{2}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a A +\frac {3 B b}{2}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +\frac {9 B b}{4}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {a A}{2}+\frac {3 B b}{8}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (4 a A -8 A b -8 B a +5 B b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (4 a A +8 A b +8 B a +5 B b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (12 a A -40 A b -40 B a -9 B b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {\left (12 a A +40 A b +40 B a -9 B b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(247\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.77 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\frac {3 \, {\left (4 \, A a + 3 \, B b\right )} d x + {\left (6 \, B b \cos \left (d x + c\right )^{3} + 8 \, {\left (B a + A b\right )} \cos \left (d x + c\right )^{2} + 16 \, B a + 16 \, A b + 3 \, {\left (4 \, A a + 3 \, B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (97) = 194\).
Time = 0.18 (sec) , antiderivative size = 252, normalized size of antiderivative = 2.40 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\begin {cases} \frac {A a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {A a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {A a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 A b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {A b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {2 B a \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {B a \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 B b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 B b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 B b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 B b \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 B b \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (A + B \cos {\left (c \right )}\right ) \left (a + b \cos {\left (c \right )}\right ) \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.96 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\frac {24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b + 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B b}{96 \, d} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.85 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\frac {1}{8} \, {\left (4 \, A a + 3 \, B b\right )} x + \frac {B b \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (B a + A b\right )} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (A a + B b\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {3 \, {\left (B a + A b\right )} \sin \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
Time = 0.51 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.11 \[ \int \cos ^2(c+d x) (a+b \cos (c+d x)) (A+B \cos (c+d x)) \, dx=\frac {A\,a\,x}{2}+\frac {3\,B\,b\,x}{8}+\frac {3\,A\,b\,\sin \left (c+d\,x\right )}{4\,d}+\frac {3\,B\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {A\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,b\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,b\,\sin \left (4\,c+4\,d\,x\right )}{32\,d} \]
[In]
[Out]